﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Core.Log.Operate;
using Frame.Lib.Core.Log.Message;
using Frame.Lib.Core.Log.Exceptions;
using Frame.Lib.Core.Log.Login;

namespace Frame.Lib.Core.Log
{
    public sealed class Logger
    {
        public static void Login(int userID, string loginName, string userName, string userIP, int loginResult)
        {
            LogLoginBO log = new LogLoginBO();
            log.Write(userID, loginName, userName, userIP, loginResult);
        }

        public static void Exception(Exception ex, string tag)
        {
            LogExceptionBO log = new LogExceptionBO();
            log.Write(ex, tag);
        }

        public static void Exception(Exception ex)
        {
            Exception(ex, null);
        }

        public static void Message(string message, string name)
        {
            LogMessageBO log = new LogMessageBO();
            log.Write(message, name);
        }

        public static void Message(string message)
        {
            Message(message, "");
        }

        public static void Operate(OperateType operateType, string tableName, string detail)
        {
            LogOperateBO log = new LogOperateBO();
            log.Write(operateType, tableName, detail);
        }
    }
}
